﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_GetUserMenu')
	BEGIN
		DROP  Procedure  [esf_sso].P_GetUserMenu
	END

GO


CREATE Procedure [esf_sso].P_GetUserMenu
	@pID	INT
AS

	SELECT
		VU.ChiBR_ID				ID
		,VU.ChiBR_Code			Code
		,VU.ChiBR_Name			Name
		,VU.ChiBR_Description	Description
		,VU.URL
		,VU.ChiBR_Extra_I		Extra_I
		,VU.ChiBR_IsEnabled		IsEnabled
		,VU.ParBR_Code			ParentCode
		,VU.ParBR_ID			ParentID		
	FROM 
		[esf_sso].VUserMenus VU
	WHERE 
		VU.ChiBR_ID = @pID
		AND VU.ChiBR_BasicReferenceTypeID = 7

GO